home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Various / DevDisk 65 (1989)(DevWare PD).zip / DevDisk 65 (1989)(DevWare PD).adf / prosuite / xtext.h < prev    next >
C/C++ Source or Header  |  1990-07-11  |  3KB  |  126 lines

  1. #ifndef XTEXT_H
  2. #define XTEXT_H
  3.  
  4.  
  5. /* *** xtext.h **************************************************************
  6.  *
  7.  * XText Routines
  8.  *     from Book 1 of the Amiga Programmers' Suite by RJ Mical
  9.  *
  10.  * Copyright (C) 1986, 1987, Robert J. Mical
  11.  * All Rights Reserved.
  12.  *
  13.  * Created for Amiga developers.
  14.  * Any or all of this code can be used in any program as long as this
  15.  * entire notice is retained, ok?  Thanks.
  16.  *
  17.  * HISTORY       NAME            DESCRIPTION
  18.  * -----------   --------------  --------------------------------------------
  19.  * 27 Oct 86     RJ              Add XText buffer stuff, prepare for release
  20.  * March 86      RJ              Incorporated this code in Sidecar
  21.  * 26 Jan 86     RJ Mical        Created this file (on my birthday!)
  22.  *
  23.  * *********************************************************************** */
  24.  
  25.  
  26. #include <exec/types.h>
  27. #include <exec/memory.h>
  28.  
  29. #include <intuition/intuition.h>
  30.  
  31.  
  32.  
  33.  
  34. /* === System Macros ==================================================== */
  35. #define SetFlag(v,f)        ((v)|=(f))
  36. #define ClearFlag(v,f)        ((v)&=~(f))
  37. #define ToggleFlag(v,f)     ((v)^=(f))
  38. #define FlagIsSet(v,f)        ((BOOL)(((v)&(f))!=0))
  39. #define FlagIsClear(v,f)    ((BOOL)(((v)&(f))==0))
  40.  
  41.  
  42.  
  43. /* === XText Support Structure =========================================== */
  44. struct XTextSupport
  45.     {
  46.     BYTE FrontPen, BackPen;
  47.     BYTE DrawMode;
  48.  
  49.     BYTE MaxTextWidth;
  50.  
  51.     SHORT CharHeight;
  52.     SHORT Flags;
  53.  
  54.     UBYTE *NormalTextPlane;
  55.     UBYTE *InverseTextPlane;
  56.     UBYTE *AllClearPlane;
  57.     UBYTE *AllSetPlane;
  58.  
  59.     struct Remember *XTextKey;
  60.  
  61.     struct RastPort *OutputRPort;
  62.  
  63.     SHORT FontSelect;        /* Definitions for FontSelect are below */
  64.     UBYTE *FontData[8];
  65.  
  66.     struct BitMap TextBitMap;
  67.     };
  68.  
  69.  
  70. /* === FontSelect Definitions === */
  71. /* Though these are given names, these are basically just indices into the
  72.  * FontData array.
  73.  */
  74. #define NORMAL_FONT                    0        /* The default, don'cha know */
  75. #define BOLD_FONT                    1
  76. #define ULINE_FONT                    2
  77. #define ULINE_BOLD_FONT                3
  78. #define ITALIC_FONT                    4
  79. #define ITALIC_BOLD_FONT            5
  80. #define ITALIC_ULINE_FONT            6
  81. #define ITALIC_ULINE_BOLD_FONT        7
  82.  
  83. /* === XTextSupport Flags Definitions === */
  84. #define SLIM_XTEXT    0x0001
  85.  
  86.  
  87.  
  88. /* === XText Miscellaneous Definitions =================================== */
  89. #define XTEXT_CHARWIDTH                8        /* This is sacrosanct */
  90.  
  91. /* The ITALIC_LEFT_EDGE is used to determine which slice of the italic
  92.  * imagery is used for the font imagery.
  93.  * The value of this constant is used as the starting left column of
  94.  * font imagery after italics have been applied to the font.
  95.  * If you haven't the foggiest notion what this means, leave this
  96.  * constant alone and you'll be OK.
  97.  */
  98. #define ITALIC_LEFT_EDGE            1
  99.  
  100.  
  101.  
  102. /* === Function Definitions ============================================== */
  103. UBYTE *AllocMem();
  104. UBYTE *AllocRemember();
  105.  
  106. struct XTextSupport *MakeXTextSupport();
  107.  
  108. struct TextFont *OpenDiskFont();
  109. struct TextFont *OpenFont();
  110. UBYTE *OpenLibrary();
  111. struct Screen *OpenScreen();
  112. struct TmpRas *InitTmpRas();
  113. struct Window *OpenWindow();
  114.  
  115.  
  116.  
  117. /* === And finally, eglobal inclusion ==================================== */
  118. #ifndef EGLOBAL_CANCEL
  119. #include "eglobal.c"
  120. #endif
  121.  
  122.  
  123. #endif /* of XTEXT_H */
  124.  
  125.  
  126.